<template>
  <view class="content">
    <view :style="{color:'rgb(173, 173, 173)','text-align':'center',padding:'0 30rpx'}" v-if="showAnTitle">{{anTitle}}</view>
    <view
      class="card"
      v-for="(item, index) in list"
      :key="index"
      @click="goPage(item)"
    >
      
      <view class="img">
        <image :src="item.img_avatar_url || item.img_url"></image>
      </view>
      <view class="right">
        <view class="right_content">
          <view class="book">{{ item.name }}</view>
          <view class="name">{{ item.author }}</view>
        </view>
        <view class="font" v-html="item.abstract">
          <!-- {{ item.abstract }} -->
        </view>
      </view>
    </view>
  </view>
</template>
<script>
import storage from "@/common/storage"; // 缓存封装
export default {
  props: {
    list: {
      type: Array,
      default: () => [],
    },
    showAnTitle:{
      type:Boolean,
      default:false
    }
  },
  data() {
    return {
      anTitle:''
    };
  },
  mounted() {
    this.anTitle = storage.get('shanAn').xingyungongchuang
  },
  methods: {
    goPage(item) {
        
        uni.navigateTo({
          url: `/pages/home/coCreateList?pid=${item.id}&title=${item.name}`,
        });

        
     
    },
  },
};
</script>
<style scoped lang="scss">
.content {
  height: 100%;
  padding: 20rpx 0rpx;
  .card {
    margin-left: 30rpx;
    margin-top: 48rpx;
    width: 690rpx;
    height: 214rpx;
    display: flex;
    // background: rgba(39, 39, 39, 0.5);
    .img {
      width: 160rpx;
      height: 214rpx;
      image {
        border-radius: 8rpx;
        width: 100%;
        height: 100%;
      }
    }
    .right {
      margin-left: 32rpx;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .right_content {
        .book {
          font-size: 38rpx;
          font-family: PingFang SC-Bold, PingFang SC;
          font-weight: 400;
          color: #eeeeee;
          line-height: 48rpx;
        }
        .name {
          font-size: 32rpx;
          font-family: PingFang SC-Medium, PingFang SC;
          font-weight: 400;
          color: #adadad;
          line-height: 38rpx;
        }
      }
      .font {
        // margin-top: 48rpx;
        width: 442rpx;
        // height: 76rpx;
        font-size: 26rpx;
        font-family: PingFang SC-Medium, PingFang SC;
        font-weight: 400;
        color: #eeeeee;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
        -webkit-line-clamp: 2;
        text-overflow: ellipsis;
      }
    }
  }
}
</style>